<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2025/9/6
  Time: 上午10:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>欢迎</title>
</head>
<body>
    <!-- 页面标题 -->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <h2 style="margin-bottom: 20px; font-weight: 500;">
                <%-- 动态显示欢迎语与当前时间 --%>
                <%
                    String username = (String) session.getAttribute("username");
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
                    String currentTime = sdf.format(new Date());
                %>
                欢迎您，<%= username != null ? username : "管理员" %>！当前时间：<%= currentTime %>
            </h2>
        </div>
    </div>

    <!-- 数据概览卡片（核心指标） -->
    <div class="layui-row layui-col-space15">
        <!-- 学生总数 -->
        <div class="layui-col-md3">
            <div class="layui-card dashboard-card">
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-md8">
                            <h3 class="layui-card-title" style="color: #666;">学生总数</h3>
                            <p class="layui-card-number" style="font-size: 24px; margin-top: 10px;">2,356</p>
                            <p class="layui-card-desc" style="color: #999; margin-top: 5px;">较上学期增长 8.2%</p>
                        </div>
                        <div class="layui-col-md4" style="text-align: center; padding-top: 10px;">
                            <i class="layui-icon layui-icon-user" style="font-size: 40px; color: #1AB394;"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 教师总数 -->
        <div class="layui-col-md3">
            <div class="layui-card dashboard-card">
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-md8">
                            <h3 class="layui-card-title" style="color: #666;">教师总数</h3>
                            <p class="layui-card-number" style="font-size: 24px; margin-top: 10px;">189</p>
                            <p class="layui-card-desc" style="color: #999; margin-top: 5px;">较上学期增长 3.5%</p>
                        </div>
                        <div class="layui-col-md4" style="text-align: center; padding-top: 10px;">
                            <i class="layui-icon layui-icon-teacher" style="font-size: 40px; color: #4E9FFF;"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 课程总数 -->
        <div class="layui-col-md3">
            <div class="layui-card dashboard-card">
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-md8">
                            <h3 class="layui-card-title" style="color: #666;">课程总数</h3>
                            <p class="layui-card-number" style="font-size: 24px; margin-top: 10px;">428</p>
                            <p class="layui-card-desc" style="color: #999; margin-top: 5px;">本学期新增 36 门</p>
                        </div>
                        <div class="layui-col-md4" style="text-align: center; padding-top: 10px;">
                            <i class="layui-icon layui-icon-book" style="font-size: 40px; color: #FFB800;"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 待处理事项 -->
        <div class="layui-col-md3">
            <div class="layui-card dashboard-card">
                <div class="layui-card-body">
                    <div class="layui-row">
                        <div class="layui-col-md8">
                            <h3 class="layui-card-title" style="color: #666;">待处理事项</h3>
                            <p class="layui-card-number" style="font-size: 24px; margin-top: 10px; color: #FF5722;">12</p>
                            <p class="layui-card-desc" style="color: #999; margin-top: 5px;">包含成绩审核、请假审批</p>
                        </div>
                        <div class="layui-col-md4" style="text-align: center; padding-top: 10px;">
                            <i class="layui-icon layui-icon-clock" style="font-size: 40px; color: #FF5722;"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 快捷操作区（高频功能） -->
    <div class="layui-row layui-col-space15" style="margin-top: 20px;">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <i class="layui-icon layui-icon-light" style="margin-right: 8px;"></i>快捷操作
                </div>
                <div class="layui-card-body">
                    <button class="layui-btn layui-btn-primary layui-btn-lg" lay-href="student_add.jsp">
                        <i class="layui-icon layui-icon-user"></i>添加学生
                    </button>
                    <button class="layui-btn layui-btn-primary layui-btn-lg" lay-href="course_add.jsp">
                        <i class="layui-icon layui-icon-book"></i>添加课程
                    </button>
                    <button class="layui-btn layui-btn-primary layui-btn-lg" lay-href="score_input.jsp">
                        <i class="layui-icon layui-icon-graduation-cap"></i>录入成绩
                    </button>
                    <button class="layui-btn layui-btn-primary layui-btn-lg" lay-href="notice_add.jsp">
                        <i class="layui-icon layui-icon-notice"></i>发布通知
                    </button>
                    <button class="layui-btn layui-btn-primary layui-btn-lg" lay-href="student_import.jsp">
                        <i class="layui-icon layui-icon-upload"></i>批量导入
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!-- 通知公告区 -->
    <div class="layui-row layui-col-space15" style="margin-top: 20px;">
        <div class="layui-col-md8">
            <div class="layui-card">
                <div class="layui-card-header">
                    <i class="layui-icon layui-icon-notice" style="margin-right: 8px;"></i>最新通知
                    <a href="notice_list.jsp" style="float: right; font-size: 12px; color: #4E9FFF;">查看全部</a>
                </div>
                <div class="layui-card-body" style="padding: 0;">
                    <ul style="padding: 0 15px;">
                        <!-- 通知1 -->
                        <li class="notice-item">
                            <span>关于2024-2025学年第一学期选课时间调整的通知</span>
                            <span class="notice-time">2024-09-01</span>
                        </li>
                        <!-- 通知2 -->
                        <li class="notice-item">
                            <span>2024级新生报到须知及入学教育安排</span>
                            <span class="notice-time">2024-08-25</span>
                        </li>
                        <!-- 通知3 -->
                        <li class="notice-item">
                            <span>关于开展2024年秋季学期教师教学培训的通知</span>
                            <span class="notice-time">2024-08-20</span>
                        </li>
                        <!-- 通知4 -->
                        <li class="notice-item">
                            <span>2023-2024学年第二学期成绩查询开放通知</span>
                            <span class="notice-time">2024-07-15</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <!-- 系统统计图表（示例：本学期课程类型分布） -->
        <div class="layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header">
                    <i class="layui-icon layui-icon-chart" style="margin-right: 8px;"></i>课程类型分布
                </div>
                <div class="layui-card-body">
                    <!-- 引入 Layui 图表 -->
                    <div id="courseChart" style="width: 100%; height: 220px;"></div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
